﻿using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Thor.Core;

namespace Thor.Application
{
    /// <summary>
    /// 用户管理
    /// </summary>
    [ApiDescriptionSettings(ApiGroupConstant.USER_MANAGE)]
    public class UserManageService : IDynamicApiController
    {
        private readonly IUserService _userService;

        public UserManageService(IUserService userService)
        {
            _userService = userService;
        }

        /// <summary>
        /// 测试方法
        /// </summary>
        /// <returns></returns>
        [Transactional]
        public async Task<string> Get()
        {
            await _userService.add(new User { Code = 1, Name = "fhl" });
            //throw new Exception("测试事务");
            return $"测试1: {nameof(Furion)}";
        }
    }
}
